package com.example.fw;

import java.util.List;

import com.example.tests.ContactData;
import com.example.tests.GroupData;
import com.example.utils.SortedListOf;

public class ApplicationModel {
	
	private SortedListOf<GroupData> groups;
	private SortedListOf<ContactData> contacts;
	
	public SortedListOf<GroupData> getGroups(){
		return groups;
	}
	
	public SortedListOf<ContactData> getContact(){
		return contacts;
	}

	public void setGroups(List<GroupData> groups) {
		this.groups = new SortedListOf<GroupData>(groups);
	}
	
	public void setContacts(List<ContactData> contacts){
		this.contacts = new SortedListOf<ContactData>(contacts);
	}

	/* GROUPS */
	public ApplicationModel addGroup(GroupData i_group) {
		groups.add(i_group);
		return this;
	}

	public ApplicationModel deleteGroup(int i_indx) {
		groups.remove(i_indx);
		return this;
	}
	
	/* CONTACTS */
	public ApplicationModel addContact(ContactData i_contact) {
		contacts.add(i_contact);
		return this;
	}

	public ApplicationModel deleteContact(int i_indx) {
		contacts.remove(i_indx);
		return this;
	}
 }
